<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script>




  </script>
</head>
<body>

<input type="button" value="按钮" id="btn"/>
<script>
  //点击按钮,弹出对话框
  document.getElementById("btn").onclick=function () {
      alert("哎呀,我被点了");
  };
</script>

</body>
</html>